home *** CD-ROM | disk | FTP | other *** search
/ Amiga Developer CD 2.1 / Amiga Developer CD v2.1.iso / Reference / Includes_and_Autodocs_3.5 / include / libraries / amigaguide.h next >
Encoding:
C/C++ Source or Header  |  1999-10-20  |  7.4 KB  |  240 lines

  1. #ifndef LIBRARIES_AMIGAGUIDE_H
  2. #define LIBRARIES_AMIGAGUIDE_H
  3. /*
  4. **    $VER: amigaguide.h 44.1 (14.3.1999)
  5. **    Includes Release 44.1
  6. **
  7. **    Interface definitions for AmigaGuide(tm) hypertext system
  8. **
  9. **    (C) Copyright 1990-1999 Amiga, Inc.
  10. **        All Rights Reserved
  11. */
  12. #ifndef EXEC_TYPES_H
  13. #include <exec/types.h>
  14. #endif /* EXEC_TYPES_H */
  15.  
  16. #ifndef EXEC_LISTS_H
  17. #include <exec/lists.h>
  18. #endif /* EXEC_LISTS_H */
  19.  
  20. #ifndef EXEC_NODES_H
  21. #include <exec/nodes.h>
  22. #endif /* EXEC_NODES_H */
  23.  
  24. #ifndef EXEC_SEMAPHORES_H
  25. #include <exec/semaphores.h>
  26. #endif
  27.  
  28. #ifndef INTUITION_INTUITION_H
  29. #include <intuition/intuition.h>
  30. #endif
  31.  
  32. #ifndef INTUITION_SCREENS_H
  33. #include <intuition/screens.h>
  34. #endif
  35.  
  36. #ifndef INTUITION_CLASSUSR_H
  37. #include <intuition/classusr.h>
  38. #endif
  39.  
  40. #ifndef DOS_DOS_H
  41. #include <dos/dos.h>
  42. #endif
  43.  
  44. #ifndef UTILITY_TAGITEM_H
  45. #include <utility/tagitem.h>
  46. #endif
  47.  
  48. #ifndef APSH_TOOL_ID
  49. #define    APSH_TOOL_ID 11000L
  50. #define    StartupMsgID        (APSH_TOOL_ID+1L)    /* Startup message */
  51. #define    LoginToolID        (APSH_TOOL_ID+2L)    /* Login a tool SIPC port */
  52. #define    LogoutToolID        (APSH_TOOL_ID+3L)    /* Logout a tool SIPC port */
  53. #define    ShutdownMsgID        (APSH_TOOL_ID+4L)    /* Shutdown message */
  54. #define    ActivateToolID        (APSH_TOOL_ID+5L)    /* Activate tool */
  55. #define    DeactivateToolID    (APSH_TOOL_ID+6L)    /* Deactivate tool */
  56. #define    ActiveToolID        (APSH_TOOL_ID+7L)    /* Tool Active */
  57. #define    InactiveToolID        (APSH_TOOL_ID+8L)    /* Tool Inactive */
  58. #define    ToolStatusID        (APSH_TOOL_ID+9L)    /* Status message */
  59. #define    ToolCmdID        (APSH_TOOL_ID+10L)    /* Tool command message */
  60. #define    ToolCmdReplyID        (APSH_TOOL_ID+11L)    /* Reply to tool command */
  61. #define    ShutdownToolID        (APSH_TOOL_ID+12L)    /* Shutdown tool */
  62. #endif
  63.  
  64. /* Attributes accepted by GetAmigaGuideAttr() */
  65. #define    AGA_Dummy        (TAG_USER)
  66. #define    AGA_Path        (AGA_Dummy+1)
  67. #define    AGA_XRefList        (AGA_Dummy+2)
  68. #define    AGA_Activate        (AGA_Dummy+3)
  69. #define    AGA_Context        (AGA_Dummy+4)
  70.  
  71. #define    AGA_HelpGroup        (AGA_Dummy+5)
  72.     /* (ULONG) Unique identifier */
  73.  
  74. #define    AGA_Reserved1        (AGA_Dummy+6)
  75. #define    AGA_Reserved2        (AGA_Dummy+7)
  76. #define    AGA_Reserved3        (AGA_Dummy+8)
  77.  
  78. #define    AGA_ARexxPort        (AGA_Dummy+9)
  79.     /* (struct MsgPort *) Pointer to the ARexx message port (V40) */
  80.  
  81. #define    AGA_ARexxPortName    (AGA_Dummy+10)
  82.    /* (STRPTR) Used to specify the ARexx port name (V40) (not copied) */
  83.  
  84. #define AGA_Secure        (AGA_Dummy+11)
  85.    /* (BOOL) Disable "ONOPEN", "ONCLOSE" and "LINK RX", "LINK RXS", "LINK SYSTEM" commands (V41) */
  86.  
  87. typedef void *AMIGAGUIDECONTEXT;
  88.  
  89. struct AmigaGuideMsg
  90. {
  91.     struct Message     agm_Msg;            /* Embedded Exec message structure */
  92.     ULONG         agm_Type;            /* Type of message */
  93.     APTR         agm_Data;            /* Pointer to message data */
  94.     ULONG         agm_DSize;            /* Size of message data */
  95.     ULONG         agm_DType;            /* Type of message data */
  96.     ULONG         agm_Pri_Ret;            /* Primary return value */
  97.     ULONG         agm_Sec_Ret;            /* Secondary return value */
  98.     APTR         agm_System1;
  99.     APTR         agm_System2;
  100. };
  101.  
  102. /* Allocation description structure */
  103. struct NewAmigaGuide
  104. {
  105.     BPTR         nag_Lock;            /* Lock on the document directory */
  106.     STRPTR         nag_Name;            /* Name of document file */
  107.     struct Screen    *nag_Screen;            /* Screen to place windows within */
  108.     STRPTR         nag_PubScreen;            /* Public screen name to open on */
  109.     STRPTR         nag_HostPort;            /* Application's ARexx port name */
  110.     STRPTR         nag_ClientPort;        /* Name to assign to the clients ARexx port */
  111.     STRPTR         nag_BaseName;            /* Base name of the application */
  112.     ULONG         nag_Flags;            /* Flags */
  113.     STRPTR        *nag_Context;            /* NULL terminated context table */
  114.     STRPTR         nag_Node;            /* Node to align on first (defaults to Main) */
  115.     LONG         nag_Line;            /* Line to align on */
  116.     struct TagItem    *nag_Extens;            /* Tag array extension */
  117.     VOID        *nag_Client;            /* Private! MUST be NULL */
  118. };
  119.  
  120. /* public Client flags */
  121. #define    HTF_LOAD_INDEX        (1L<<0)            /* Force load the index at init time */
  122. #define    HTF_LOAD_ALL        (1L<<1)            /* Force load the entire database at init */
  123. #define    HTF_CACHE_NODE        (1L<<2)            /* Cache each node as visited */
  124. #define    HTF_CACHE_DB        (1L<<3)            /* Keep the buffers around until expunge */
  125. #define    HTF_UNIQUE        (1L<<15)        /* Unique ARexx port name */
  126. #define    HTF_NOACTIVATE        (1L<<16)        /* Don't activate window */
  127.  
  128. #define    HTFC_SYSGADS        0x80000000
  129.  
  130. /* Callback function ID's */
  131. #define    HTH_OPEN        0
  132. #define    HTH_CLOSE        1
  133.  
  134. #define    HTERR_NOT_ENOUGH_MEMORY        100L
  135. #define    HTERR_CANT_OPEN_DATABASE    101L
  136. #define    HTERR_CANT_FIND_NODE        102L
  137. #define    HTERR_CANT_OPEN_NODE        103L
  138. #define    HTERR_CANT_OPEN_WINDOW        104L
  139. #define    HTERR_INVALID_COMMAND        105L
  140. #define    HTERR_CANT_COMPLETE        106L
  141. #define    HTERR_PORT_CLOSED        107L
  142. #define    HTERR_CANT_CREATE_PORT        108L
  143. #define    HTERR_KEYWORD_NOT_FOUND        113L
  144.  
  145. typedef struct AmigaGuideHost *AMIGAGUIDEHOST;
  146.  
  147. /* Cross reference node */
  148. struct XRef
  149. {
  150.     struct Node         xr_Node;            /* Embedded node */
  151.     UWORD         xr_Pad;            /* Padding */
  152.     struct DocFile    *xr_DF;                /* Document defined in */
  153.     STRPTR         xr_File;            /* Name of document file */
  154.     STRPTR         xr_Name;            /* Name of item */
  155.     LONG         xr_Line;            /* Line defined at */
  156.     ULONG                xr_Reserved[2];        /* Don't touch! (V44) */
  157. };
  158.  
  159. #define    XRSIZE    (sizeof (struct XRef))
  160.  
  161. /* Types of cross reference nodes */
  162. #define    XR_GENERIC    0
  163. #define    XR_FUNCTION    1
  164. #define    XR_COMMAND    2
  165. #define    XR_INCLUDE    3
  166. #define    XR_MACRO    4
  167. #define    XR_STRUCT    5
  168. #define    XR_FIELD    6
  169. #define    XR_TYPEDEF    7
  170. #define    XR_DEFINE    8
  171.  
  172. /* Callback handle */
  173. struct AmigaGuideHost
  174. {
  175.     struct Hook         agh_Dispatcher;        /* Dispatcher */
  176.     ULONG         agh_Reserved;            /* Must be 0 */
  177.     ULONG         agh_Flags;
  178.     ULONG         agh_UseCnt;            /* Number of open nodes */
  179.     APTR         agh_SystemData;        /* Reserved for system use */
  180.     APTR         agh_UserData;            /* Anything you want... */
  181. };
  182.  
  183. /* Methods */
  184. #define    HM_FINDNODE    1
  185. #define    HM_OPENNODE    2
  186. #define    HM_CLOSENODE    3
  187. #define    HM_EXPUNGE    10        /* Expunge DataBase */
  188.  
  189. /* HM_FINDNODE */
  190. struct opFindHost
  191. {
  192.     ULONG MethodID;
  193.     struct TagItem *ofh_Attrs;        /*  R: Additional attributes */
  194.     STRPTR ofh_Node;            /*  R: Name of node */
  195.     STRPTR ofh_TOC;            /*  W: Table of Contents */
  196.     STRPTR ofh_Title;            /*  W: Title to give to the node */
  197.     STRPTR ofh_Next;            /*  W: Next node to browse to */
  198.     STRPTR ofh_Prev;            /*  W: Previous node to browse to */
  199. };
  200.  
  201. /* HM_OPENNODE, HM_CLOSENODE */
  202. struct opNodeIO
  203. {
  204.     ULONG MethodID;
  205.     struct TagItem *onm_Attrs;        /*  R: Additional attributes */
  206.     STRPTR onm_Node;            /*  R: Node name and arguments */
  207.     STRPTR onm_FileName;        /*  W: File name buffer */
  208.     STRPTR onm_DocBuffer;        /*  W: Node buffer */
  209.     ULONG onm_BuffLen;            /*  W: Size of buffer */
  210.     ULONG onm_Flags;            /* RW: Control flags */
  211. };
  212.  
  213. /* onm_Flags */
  214. #define    HTNF_KEEP    (1L<<0)    /* Don't flush this node until database is
  215.                  * closed. */
  216. #define    HTNF_RESERVED1    (1L<<1)    /* Reserved for system use */
  217. #define    HTNF_RESERVED2    (1L<<2)    /* Reserved for system use */
  218. #define    HTNF_ASCII    (1L<<3)    /* Node is straight ASCII */
  219. #define    HTNF_RESERVED3    (1L<<4)    /* Reserved for system use */
  220. #define    HTNF_CLEAN    (1L<<5)    /* Remove the node from the database */
  221. #define    HTNF_DONE    (1L<<6)    /* Done with node */
  222.  
  223. /* onm_Attrs */
  224. #define    HTNA_Dummy    (TAG_USER)
  225. #define    HTNA_Screen    (HTNA_Dummy+1)    /* (struct Screen *) Screen that window resides in */
  226. #define    HTNA_Pens    (HTNA_Dummy+2)    /* Pen array (from DrawInfo) */
  227. #define    HTNA_Rectangle    (HTNA_Dummy+3)    /* Window box */
  228.  
  229. #define    HTNA_HelpGroup    (HTNA_Dummy+5)    /* (ULONG) unique identifier */
  230.  
  231.  
  232. /* HM_EXPUNGE */
  233. struct opExpungeNode
  234. {
  235.     ULONG MethodID;
  236.     struct TagItem *oen_Attrs;        /*  R: Additional attributes */
  237. };
  238.  
  239. #endif /* LIBRARIES_AMIGAGUIDE_H */
  240.